package com.zhaojindong.ioc.component.register.conditional;

import com.zhaojindong.ioc.component.common.model.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * created by dean on 2018/08/18
 *
 */

@Configuration
public class MainConfig {

    @Conditional(WindowsCondition.class)
    @Bean("bill")
    public Person person1() {
        return new Person("Bili Gates", 50);
    }

    @Conditional(LinuxCondition.class)
    @Bean("linus")
    public Person person2() {
        return new Person("Linus", 45);
    }
}